<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        //js中不支持多继承
        // class father {
        //     constructor(a1) {
        //         this.a1 = a1;
        //     }
        // }
        // class mother {
        //         constructor(a2) {
        //             this.a2 = a2;
        //         }
        // }
        // class son extends father,mother{

        // }



        //原生js中可以模拟属性多继承，但方法没有
        function father(a1) {
            this.a1 = a1
        }
        function mother(a2) {
            this.a2 = a2;
        }
        function son(a1, a2) {
            father.call(this, a1);
            mother.call(this, a2);
        }
        var a = new son('t', 'abc')
        console.log(a)



        //类没有变量提升：必须先定义类，再创建对象
            // // var a = new student('t')
            // class student {
            //     constructor(name) {
            //         this.name = name;
            //     }
            // }
            // var a = new student('t');
            // console.log(a);
    </script>
</body>

</html>